/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.FileInputStream;
import java.util.Arrays;

/**
 * <p>Project: jse2302 - InputStream2
 * <p>Powered by webrx On 2023-06-27 11:38:18
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class InputStream2 {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("user.txt");
        int i = fis.read();
        System.out.println(i);

        byte[] buf = new byte[6];
        int len = 0;
        System.out.println(len);
        len = fis.read(buf);
        System.out.println(len);
        System.out.println(Arrays.toString(buf));

        len = fis.read(buf);
        System.out.println(len);
        System.out.println(Arrays.toString(buf));

        len = fis.read(buf);
        System.out.println(len);
        System.out.println(Arrays.toString(buf));

        len = fis.read(buf);
        System.out.println(len);
        System.out.println(Arrays.toString(buf));


    }
}
